package com.yunfeisoft.business.service.impl;

import com.applet.base.BaseServiceImpl;
import com.yunfeisoft.business.dao.inter.SmsCouponProductCategoryRelationDao;
import com.yunfeisoft.business.model.SmsCouponProductCategoryRelation;
import com.yunfeisoft.business.service.inter.SmsCouponProductCategoryRelationService;
import com.applet.sql.separation.DataSourceChange;
import com.applet.utils.Page;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

/**
 * ClassName: SmsCouponProductCategoryRelationServiceImpl
 * Description: 优惠券和产品分类关系表service实现
 * Author: Jackie liu
 * Date: 2020-06-02
 */
@Service("smsCouponProductCategoryRelationService")
public class SmsCouponProductCategoryRelationServiceImpl extends BaseServiceImpl<SmsCouponProductCategoryRelation, String, SmsCouponProductCategoryRelationDao> implements SmsCouponProductCategoryRelationService {

    @Autowired
    private SmsCouponProductCategoryRelationDao categoryRelationDao;

    @Override
    @DataSourceChange(slave = true)
    public Page<SmsCouponProductCategoryRelation> queryPage(Map<String, Object> params) {
        return getDao().queryPage(params);
    }

    @Override
    public void deleteByCouponId(String couponId) {
        categoryRelationDao.deleteByCouponId(couponId);
    }

    @Override
    public List<SmsCouponProductCategoryRelation> queryByCouponId(String couponId) {
        return getDao().queryByCouponId(couponId);
    }
}